package org.example.platform.beans.simple;

/**
 * 测试简单Bean容器
 */
public class Test {
    public static void main(String[] args) {
        // 初始化BeanFactory
        BeanFactory beanFactory = new BeanFactory();

        // 注册bean
        BeanDefinition beanDefinition = new BeanDefinition(new UserService());
        beanFactory.registerBeanDefinition("userService",beanDefinition);

        // 获取bean
        UserService userService = (UserService) beanFactory.getBean("userService");
        userService.queryUser();
    }
}
